<?php if(!defined("PATH_HD"))exit;C("SHOW_NOTICE",false);?><?php if(!defined("PATH_HD"))exit;C("SHOW_NOTICE",false);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>        
        <title></title>
        <meta http-equiv="content-type" content="text/htm;charset=utf-8"/>
        <link type="text/css" rel="stylesheet" href="http://192.168.10.155:8080/sz-ica/admin/tpl/public/css/common.css"/>
        <script type='text/javascript' src='http://192.168.10.155:8080/sz-ica/hdphp/plugin/jquery-1.8.2.min.js'></script>
        <my_jqueryui/>
       <script type="text/javascript" src="http://192.168.10.155:8080/sz-ica/admin/tpl/public/js/admin.js"></script>
        <script type='text/javascript'>
            $(function(){
                $('tr').mouseover(function(){
                    $(this).css('background-color','#f6f6f6');
                }).mouseout(function(){
                    $(this).css('background-color','#fff');
                });
            });
        </script>
    </head>
    <body>
        <div id="hd_jqueryui_div"></div>
<ul class="top_title">
    <li>
        <p class="menu_title">内容分类</p>
    </li>
    <li>|</li>
    <li>
        <a href="http://192.168.10.155:8080/sz-ica/admin.php/Info/addList" class="menu_title_a" >
            <i class="icon icon-plus-sign"></i>&nbsp;添加分类
        </a>
    </li>
</ul>
<form action="http://192.168.10.155:8080/sz-ica/admin.php/index/sort" method="post">
    <table class="table">
        <thead>
            <tr class="top_channel">
                <th align="center" width="60">ID</th>
                <th align="center" width="40">排序</th>
                <th width='20'></th>
                <th align="center" width="26%">栏目名称</th>
                <th align="center" width="100">是否使用</th>
                <th align="center" width="100">前台显示</th>
                <th align="center">操作</th>
            </tr>
        </thead>
        <tbody>
      

        <?php if(is_array($list)):?><?php  foreach($list as $v){ ?>
            <tr class="top_channel">
           
                <td align="center">
                    <input type="text" disabled="disabled" value="<?php echo $v['id'];?>"  class="input-medium"/>
                </td>
                <td align="center">
                    <input type="text" disabled="disabled" value="<?php echo $v['orders'];?>"  class="input-medium" size="5" />
                </td>
                <td width='20'></td>
                <td align="left" class="dis">
                    |-
                    <?php
                        //编辑分类头分割符
                        $num = count(explode('-',$v['path']));
                        echo str_repeat('-', $num*2);
                    ?>
                    <?php echo $v['name'];?>
                </td>
                
                <td align="center">
                    <?php if($v['isshow']){?>
                        <span class="btn isshow" id='<?php echo $v['id'];?>' style='color:#888'  zt='<?php echo $v['isshow'];?>' lid='<?php echo $v['id'];?>'>使用</span>
                        <?php  }else{ ?>
                        <span class="btn isshow" id='<?php echo $v['id'];?>' style='color:#f60'  zt='<?php echo $v['isshow'];?>' lid='<?php echo $v['id'];?>'>禁止</span>

                    <?php }?>
                </td>
                <td align="center">
                    <?php if($v['navshow']){?>
                        <span class="btn navshow" id='<?php echo $v['id'];?>_f' style='color:#888'  zt='<?php echo $v['navshow'];?>' lid='<?php echo $v['id'];?>'>使用</span>
                        <?php  }else{ ?>
                        <span class="btn navshow" id='<?php echo $v['id'];?>_f' style='color:#f60'  zt='<?php echo $v['navshow'];?>' lid='<?php echo $v['id'];?>'>禁止</span>

                    <?php }?>
                </td>

                <td align="center">
                    
                    <a href="http://192.168.10.155:8080/sz-ica/admin.php/Info/editList?id=<?php echo $v['id'];?>" class="isok btn edit">

                        <i class="icon icon-edit"></i>&nbsp;编辑
                    </a>
                    |
                    <a href="http://192.168.10.155:8080/sz-ica/admin.php/Info/delList?id=<?php echo $v['id'];?>" class="isok btn del">
                        <i class="icon icon-trash"></i>&nbsp;删除
                    </a>
                </td>
            </tr>
        <?php }?><?php endif;?>

            <tr class="top_channel">
                <td></td>
                <td align="center">
                    
                </td>
                <td colspan="5"> <?php echo $page;?></td>
            </tr>
        </tbody>
    </table>
</form>
<script type='text/javascript'>
    $(function(){
        $('.del').click(function(){
            var cn = confirm('确定删除吗？');
            if(!cn){
                return false;
            }
        });
         //内容分类ajax修改使用状态
          $('.isshow').live('click',function (){

            var zt = $(this).attr('zt');
            var id = $(this).attr('lid');
            ajaxChange('infoListAjax',id,zt);
    
         });


           //内容分类ajax修改前台显示
          $('.navshow').live('click',function (){

            var zt = $(this).attr('zt');
            var id = $(this).attr('lid');
            ajaxChange('ajaxNavShow',id,zt);
    
         });


   
    });

    function ajaxChange(action,id,zt){
          
             $.post('http://192.168.10.155:8080/sz-ica/admin.php/Info/'+action,{'id':id,'zt':zt},function(data){
               if(data.ids){//返回真，更新成功，修改前台css显示
               //  history.go(0);
                    for(num in data.ids){
                       if(zt=='1'){
                            $('#'+data.ids[num]['id']).css('color','#f60').attr('zt','0').html('禁止');
                        }else{
                          //alert('222');
                           $('#'+data.ids[num]['id']).css('color','#888').attr('zt','1').html('使用');

                       }
                
                   }
               // history.go(0);
                
               }else{
                  alert('出错了');
               }
            },"json");
        
    }
       // //修改使用状态
       //  function takeChange(data,zt){
       //   alert(data);
       //  }
</script>
</body>

</html>